
//
//  OrderGoodsInfoCell.m
//  LuxuryGoods
//
//  Created by DCQ on 2018/5/29.
//  Copyright © 2018年 Future. All rights reserved.
//

#import "OrderGoodsImgCell.h"
#import "OrderListModel.h"
#import "IdOrMteDetailModel.h"
@interface OrderGoodsImgCell()
@property (weak, nonatomic) IBOutlet UIImageView *imgV;
@property (weak, nonatomic) IBOutlet UILabel *detailLabel;
@property (weak, nonatomic) IBOutlet UILabel *numberLabel;
@property (weak, nonatomic) IBOutlet UILabel *unitPriceLabel;

@end
@implementation OrderGoodsImgCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}
- (void)setupADdressData:(id)data{
    NSString * imgUrl = @"";
    NSString * goods_title= @"";
    NSString * unit_price = @"";
    NSString * buy_num = @"";
    if ([data isKindOfClass:[GoodsModel class]]) {
          GoodsModel * model =  data;
        imgUrl = model.goods_img;
        goods_title = model.goods_title;
        unit_price = model.unit_price;
        buy_num = [NSString stringWithFormat:@"x%@",model.buy_num];
    }else if ([data isKindOfClass:[IdOrMteGoodsModel class]]){
        
        IdOrMteGoodsModel * model =  data;
        imgUrl = model.cate_img;
        goods_title = model.goods_title;
        unit_price = model.unit_price;
        buy_num = [NSString stringWithFormat:@"x%@",model.buy_num];
    }
  
    [self.imgV yy_setImageWithURL:[NSURL URLWithString: imgUrl] placeholder:[UIImage imageNamed:@""]];
    self.detailLabel.text =  goods_title;
    self.numberLabel.text =  buy_num;
    self.unitPriceLabel.text = unit_price;
    
}
@end
